﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace zijian666.Data;

/// <summary>
/// 用户实体类
/// </summary>
[Table("user")]
public class User
{
    /// <summary>
    /// 用户 ID
    /// </summary>
    [Key]
    [Column("id")]
    [Description("用户 ID")]
    public int Id { get; set; }

    /// <summary>
    /// 用户名
    /// </summary>
    [Required]
    [Column("username")]
    [Description("用户名")]
    [StringLength(50)]
    public string Username { get; set; }

    /// <summary>
    /// 密码
    /// </summary>
    [Required]
    [Column("password")]
    [Description("密码")]
    [StringLength(255)]
    public string Password { get; set; }

    /// <summary>
    /// 邮箱
    /// </summary>
    [Required]
    [Column("email")]
    [Description("邮箱")]
    [StringLength(100)]
    public string Email { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Column("created_at")]
    [Description("创建时间")]
    public DateTime CreatedAt { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    [Column("updated_at")]
    [Description("更新时间")]
    public DateTime UpdatedAt { get; set; }
}